
import { createStore, applyMiddleware } from 'redux'
import reducers from './reducers'
import thunk from 'redux-thunk'
import logger from 'redux-logger'
import serverRequest from '../server/request.js'
import clientRequest from '../client/request.js'

export function getServerStore() {
    return createStore(reducers, applyMiddleware(thunk.withExtraArgument(serverRequest), logger))
}

export function getClientStore() {
    let initData = window.context.state;
    return createStore(reducers, initData, applyMiddleware(thunk.withExtraArgument(clientRequest), logger))
}
